// User types
export interface User {
  id: string;
  username: string;
  email: string;
  full_name: string;
  role: UserRole;
  department?: string;
  avatar_url?: string;
  created_at: string;
  is_active: boolean;
}

export enum UserRole {
  ADMIN = 'admin',
  MANAGER = 'manager',
  USER = 'user',
}

// Document types
export interface Document {
  id: string;
  title: string;
  file_name: string;
  file_type: string;
  file_size: number;
  category_id?: string;
  knowledge_base_id?: string;
  tags: string[];
  upload_user_id: string;
  upload_user_name: string;
  upload_time: string;
  status: DocumentStatus;
  ocr_status?: string;
  summary?: string;
  page_count?: number;
}

export enum DocumentStatus {
  PROCESSING = 'processing',
  COMPLETED = 'completed',
  FAILED = 'failed',
}

// Category types
export interface Category {
  id: string;
  name: string;
  description?: string;
  icon?: string;
  color?: string;
  parent_id?: string;
  document_count: number;
}

// Knowledge base types
export interface KnowledgeBase {
  id: string;
  name: string;
  description?: string;
  owner_id: string;
  owner_name: string;
  visibility: 'public' | 'private' | 'department';
  document_count: number;
  created_at: string;
  updated_at: string;
}

// Chat types
export interface ChatMessage {
  id: string;
  role: 'user' | 'assistant' | 'system';
  content: string;
  timestamp: string;
  sources?: DocumentSource[];
}

export interface DocumentSource {
  document_id: string;
  document_title: string;
  page_number?: number;
  relevance_score: number;
}

// API Response types
export interface ApiResponse<T = any> {
  code: number;
  message: string;
  data?: T;
}

export interface PaginatedResponse<T> {
  items: T[];
  total: number;
  page: number;
  page_size: number;
  total_pages: number;
}

// Ollama model types
export interface OllamaModel {
  name: string;
  modified_at: string;
  size: number;
  digest: string;
}

export interface ModelConfig {
  llm_model: string;
  embedding_model: string;
  ollama_base_url: string;
  temperature: number;
  max_tokens: number;
}

